package com.lagou.provider.service.user;

import com.lagou.api.pojo.User;
import com.lagou.api.user.UserService;
import com.lagou.provider.annotations.RpcService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
@RpcService
public class UserServiceImpl implements UserService {

    private static Map<String,User>  userMap = new HashMap<>();

    static {

        userMap.put("handong",new User("韩大刀","20","123456"));

        userMap.put("zhangsan",new User("张三","40","234567"));
    }

    public User getUser(String userCode) {
        System.out.println("已经处理哈哈哈");
        return userMap.get(userCode);
    }

    public void updatePassword(String userCode, String password) {
        userMap.get(userCode).setPassword(password);
    }


}
